package com.mzj.saas.jobs.bill.executor;


import com.mzj.saas.jobs.bill.service.UrgePaymentBillService;
import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 催缴账单
 * 每天10：00 催缴欠费承租人 每周一次 短信+房屋动态+服务通知
 */
@JobHandler
@Component
public class UrgePaymentBillExecutor extends IJobHandler {
    private static Logger log = LoggerFactory.getLogger(UrgePaymentBillExecutor.class);

    @Autowired
    private UrgePaymentBillService urgePaymentBillService;
    @Override
    public ReturnT<String> execute(String s) throws Exception {
        long time = System.currentTimeMillis();

        String result = urgePaymentBillService.work();

        long useTime = System.currentTimeMillis() - time;
        log.info("----> UrgePaymentBillExecutor end, result: {}, use time: {}", result, useTime);

        return SUCCESS;
    }
}
